// D6ReaderBeijing.h: interface for the D6ReaderBeijing class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_D6READERBEIJING_H__10E124AA_AA48_489F_8695_AD96873808FE__INCLUDED_)
#define AFX_D6READERBEIJING_H__10E124AA_AA48_489F_8695_AD96873808FE__INCLUDED_

#include "dcic32.h"
#pragma  comment(lib, "dcic32.lib")

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "Log.h"

class D6ReaderBeijing  
{
protected:
	HANDLE m_hReader;
	CardDataLog *m_pCardApduLog;
	int m_line;
public:
	D6ReaderBeijing();
	virtual ~D6ReaderBeijing();

	BOOL G3_Open(int iPort);
	void G3_Close();
	int  G3_Reset(DWORD &len,LPBYTE resp);
	int  G3_APDU(DWORD &len,LPBYTE comm);
	int  G3_Command(DWORD &nCosLen,BYTE *pCosCmd);
	void G3_setReadHand(HANDLE hread);

	HANDLE getReaderHandle() {
		return m_hReader;
	};

	void setApduLog(CardDataLog* pApduLog) {
		m_pCardApduLog = pApduLog;
	};
	
	CardDataLog* getApduLog() {
		return m_pCardApduLog;
	};

};

int __stdcall CardCommand(int sChannelID,DWORD &nCosLen,BYTE *pCosCmd);
int __stdcall CardReset(int sChannelID,DWORD &nCosLen,BYTE *pCosCmd);

int __stdcall IcLock();
int __stdcall IcUnLock();

#endif // !defined(AFX_D6READERBEIJING_H__10E124AA_AA48_489F_8695_AD96873808FE__INCLUDED_)
